using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace EuropeEngulfed.NET
{
    partial class NavalInterdictionResultsDialog : Form
    {
        List<MapInfo.RegionID> listOfSeaRegionsInterdicting;
        IGameStateInfoProvider gameInfoProvider;
        public NavalInterdictionResultsDialog(GameController.playerType player, List<MapInfo.RegionID> listOfSeaRegionsInterdicting, IGameStateInfoProvider gameInfoProvider, int numInterdictionHits)
        {
            InitializeComponent();
            this.listOfSeaRegionsInterdicting = listOfSeaRegionsInterdicting;
            this.gameInfoProvider = gameInfoProvider;
            this.numEnemyHitsLabel.Text = numInterdictionHits.ToString();
            /*TODO do interdiction fleet info in this dialog
            foreach(MapInfo.RegionID seaRegionID in listOfSeaRegionsInterdicting)
            {
                int numEnemyFleets = 0;
                int numFriendlyFleets = 0;
                switch (seaRegionID)
                {
                    case MapInfo.RegionID.BalticSea:
                        if (player == GameController.playerType.AxisPlayer)
                        {
                            if (gameInfoProvider.IsNationAtWar(MapInfo.CountryID.USSR))
                                numEnemyFleets = gameInfoProvider.GetFleetPointList(MapInfo.CountryID.USSR, MapInfo.RegionID.BalticSea).Count;
                            numFriendlyFleets = gameInfoProvider.GetFleetPointList(MapInfo.CountryID.Germany, MapInfo.RegionID.BalticSea).Count;
                        }
                        else
                        {
                            numEnemyFleets = gameInfoProvider.GetFleetPointList(MapInfo.CountryID.Germany, MapInfo.RegionID.BalticSea).Count;
                            numFriendlyFleets = gameInfoProvider.GetFleetPointList(MapInfo.CountryID.USSR, MapInfo.RegionID.BalticSea).Count;
                        }
                        break;
                    case MapInfo.RegionID.AtlanticOcean:
                        if (player == GameController.playerType.AxisPlayer)
                        {
                            numEnemyFleets = gameInfoProvider.GetFleetPointList(MapInfo.CountryID.GreatBritain, MapInfo.RegionID.AtlanticOcean).Count + gameInfoProvider.GetFleetPointList(MapInfo.CountryID.France, MapInfo.RegionID.AtlanticOcean).Count;
                            numFriendlyFleets = gameInfoProvider.GetFleetPointList(MapInfo.CountryID.Germany, MapInfo.RegionID.AtlanticOcean).Count;
                        }
                        else
                        {
                            numEnemyFleets = gameInfoProvider.GetFleetPointList(MapInfo.CountryID.Germany, MapInfo.RegionID.AtlanticOcean).Count;
                            numFriendlyFleets = gameInfoProvider.GetFleetPointList(MapInfo.CountryID.GreatBritain, MapInfo.RegionID.AtlanticOcean).Count + gameInfoProvider.GetFleetPointList(MapInfo.CountryID.France, MapInfo.RegionID.AtlanticOcean).Count;
                        }
                        break;
                    case MapInfo.RegionID.MediteraneanSea:
                        if (player == GameController.playerType.AxisPlayer)
                        {
                            if (gameInfoProvider.IsNationAtWar(MapInfo.CountryID.Italy))
                                numEnemyFleets = gameInfoProvider.GetFleetPointList(MapInfo.CountryID.GreatBritain, MapInfo.RegionID.MediteraneanSea).Count + gameInfoProvider.GetFleetPointList(MapInfo.CountryID.France, MapInfo.RegionID.MediteraneanSea).Count;
                            numFriendlyFleets = gameInfoProvider.GetFleetPointList(MapInfo.CountryID.Italy, MapInfo.RegionID.MediteraneanSea).Count;
                        }
                        else
                        {
                            if (gameInfoProvider.IsNationAtWar(MapInfo.CountryID.Italy))
                                numEnemyFleets = gameInfoProvider.GetFleetPointList(MapInfo.CountryID.Italy, MapInfo.RegionID.MediteraneanSea).Count;
                            numFriendlyFleets = gameInfoProvider.GetFleetPointList(MapInfo.CountryID.GreatBritain, MapInfo.RegionID.MediteraneanSea).Count + gameInfoProvider.GetFleetPointList(MapInfo.CountryID.France, MapInfo.RegionID.MediteraneanSea).Count;
                        }
                }

                /*8.22 In order to interdict, a player must have at least one Fleet Point in
                the Sea-zone for every two Fleet Points the enemy has in that same
                zone.
                if(numEnemyFleets >= numFriendlyFleets / 2)
                {
                    System.Windows.Forms.ListView fleetListView = new ListView();
                    fleetListView.BackColor = System.Drawing.SystemColors.ControlDarkDark;
                    fleetListView.Location = new System.Drawing.Point(0, 36);
                    fleetListView.Name = "friendlyFleetListView";
                    fleetListView.OwnerDraw = true;
                    fleetListView.Size = new System.Drawing.Size(697, 106);
                    fleetListView.UseCompatibleStateImageBehavior = false;
                    fleetListView.DrawItem += new DrawListViewItemEventHandler(fleetListView_DrawItem);
                    this.Size.Height += 166;
                }
            }*/
        }

        /*void fleetListView_DrawItem(object sender, DrawListViewItemEventArgs e)
        {
            throw new Exception("The method or operation is not implemented.");
        }*/

        private void OkButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}